﻿<local:DocumentBase x:Class="WPFExcelReport.JLTVV03PK"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    Loaded="Window_Loaded"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetQP" />
        <CollectionViewSource   x:Key="vwKUNDADR" Source="{Binding Path=KUNDADR,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwKDSTAMM" Source="{Binding Path=KDSTAMM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVVTLIEF" Source="{Binding Path=VVTLIEF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVVLIEF" Source="{Binding Path=VVLIEF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwWBBST" Source="{Binding Path=WBBST,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVVPACK" Source="{Binding Path=VVPACK,Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="200" />
            <RowDefinition Height="500" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2"  >
            <WrapPanel Name="ZoneOrder">
                <TextBlock FontSize="18"  Height="Auto" Width="Auto">订单号:</TextBlock>
                <TextBox   FontSize="18" Name="txtVKPAUFKRS"  Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="White" />
                <TextBox  FontSize="18" Name="txtVKPAUFLFD"  Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="White" />
                <Button  Height="30"  Width="30" Margin="10,0,0,0" Click="btnGetVVLIEF_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Search.png" />
                    </Button.Background>
                </Button>
                <TextBlock FontSize="18" Height="Auto"  Width="Auto"  Text="发货单" Margin="10,0,0,0" />
                <TextBox FontSize="18" Height="Auto"  Background="AliceBlue" Width="94" Name="txtVVLIEFSCH" Margin="10,0,0,0" Text="{Binding Path=VVLIEFSCH,Source={StaticResource ResourceKey=vwVVLIEF}}" />
                <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnGetVVLIEF" Click="btnGetVVLIEF_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Search.png" />
                    </Button.Background>
                </Button>
                <TextBox Name="txtLang">CN</TextBox>
                <Button  Height="30" Margin="0,0,0,0"  Name="btnPrintPreview" 
                    Width="30" Click="btnPrintPreview_Click" >
                    <Button.Background>
                        <ImageBrush ImageSource="Images/excel_icon.jpg" />
                    </Button.Background>
                </Button>
                <Button   Height="30" Margin="20,0,0,0"  Name="btnPrint" Width="30" Click="btnPrint_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Print.png" />
                    </Button.Background>
                </Button>                
            </WrapPanel>
        </StackPanel>
 
        <Grid Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" Margin="0,0,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="5*"></RowDefinition>
            </Grid.RowDefinitions>
            <DataGrid Grid.Row="0"
            CanUserReorderColumns="True"  
            CanUserResizeRows="True" 
            CanUserSortColumns="True" 
            AutoGenerateColumns="False"  
            EnableRowVirtualization="True"  
            RowDetailsVisibilityMode="VisibleWhenSelected"
            HorizontalAlignment="Stretch" 
            VerticalAlignment="Stretch"
            IsSynchronizedWithCurrentItem="True" 
            Opacity="10" 
            Visibility="Visible"
            ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKKOPF}}" 
            Margin="0,2,0,0" 
            x:Name="dlgVKKOPF" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="客" Binding="{Binding VKKAUFKRS}"/>
                    <DataGridTextColumn Header="单" Binding="{Binding VKKAUFLFD}"/>
                    <DataGridTextColumn Header="客户" Binding="{Binding VKKKUNDNR}"/>
                </DataGrid.Columns>
            </DataGrid  >
            <DataGrid Grid.Row="1"
            CanUserReorderColumns="True"  
          CanUserResizeRows="True" CanUserSortColumns="True" 
            AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPOS}}" 
                               Margin="0,2,0,0" 
                               x:Name="dlgVKPOS" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="客户" Binding="{Binding KDKUNDNA}"/>
                    <DataGridTextColumn Header="销" Binding="{Binding VKPAUFKRS}"/>
                    <DataGridTextColumn Header="售" Binding="{Binding VKPAUFLFD}"/>
                    <DataGridTextColumn Header="单" Binding="{Binding VKPAUFPOS}"/>
                    <DataGridTextColumn Header="品种" Binding="{Binding VKPART}"/>
                    <DataGridTextColumn Header="颜色" Binding="{Binding VKPFARBE}"/>
                    <DataGridTextColumn Header="数量" Binding="{Binding VKPMENGE1}"/>
                    <DataGridTextColumn Header="单位" Binding="{Binding VKPMEEH}"/>
                </DataGrid.Columns>
            </DataGrid  >
        </Grid>
        <Grid Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Margin="0,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"></RowDefinition>
                    <RowDefinition Height="5*"></RowDefinition> 
                </Grid.RowDefinitions>
                <DataGrid   Grid.Row="0"
                AutoGenerateColumns="False" 
                HorizontalAlignment="Stretch" 
                VerticalAlignment="Stretch"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwVVLIEF}}" 
                Margin="0,0,0,0" 
                x:Name="dlgVVLIEF" 
                Height="Auto" 
                MinHeight="100">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="发货单号" Binding="{Binding VVLIEFSCH, Converter={StaticResource ResourceKey=pnum}}"/>
                        <DataGridTextColumn Header="发货单状态" Binding="{Binding VVSTATUS}"/>
                        <DataGridTextColumn Header="发货单建议号" Binding="{Binding VVAVISNR}"/>
                    </DataGrid.Columns>
                </DataGrid  >
            <DataGrid   Grid.Row="1"
                AutoGenerateColumns="False" 
                HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                               ItemsSource="{Binding Source={StaticResource ResourceKey=vwWBBST}}" 
                               Margin="0,0,0,0" 
                               x:Name="listWBBST" Height="Auto" MinHeight="300">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="任务书" Binding="{Binding WBBART}"/>
                    <DataGridTextColumn Header="花号" Binding="{Binding WBBFARBE}"/>
                    <DataGridTextColumn Header="卷号" Binding="{Binding WBBPACKNR, Converter={StaticResource ResourceKey=pnum}}"/>
                    <DataGridTextColumn Header="缸号" Binding="{Binding WBBDPART}"/>
                        <DataGridTextColumn Header="色级" Binding="{Binding WBBTAX}"/>
                    <DataGridTextColumn Header="板号" Binding="{Binding WBBRWLFD, Converter={StaticResource ResourceKey=pnum}}"/>
                    <DataGridTextColumn Header="布卷号" Binding="{Binding WBBSTKNR, Converter={StaticResource ResourceKey=pnum}}"/> 
                    <DataGridTextColumn Header="数量(m)" Binding="{Binding WBBISTKLG, Converter={StaticResource ResourceKey=d1000}}"/> 
                    </DataGrid.Columns>
                </DataGrid  >
                <DataGrid Grid.Row="1"
                Visibility="Hidden"
                IsEnabled="False"
                HorizontalAlignment="Stretch" 
                Height="106" 
                MaxHeight="200"
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" 
                CanUserSortColumns="True" 
                AutoGenerateColumns="False"   
                EnableRowVirtualization="True"  
                RowDetailsVisibilityMode="VisibleWhenSelected"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwVVTLIEF}}" 
                Margin="0,0,0,0" 
                x:Name="listVVTLIEF" 
                IsSynchronizedWithCurrentItem="False" Opacity="10" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="发货单"  Width="80" Binding="{Binding VVTLIEFSCH}"/>
                        <DataGridTextColumn Header="运输方式" Binding="{Binding VVVERSART}"/>
                        <DataGridTextColumn Header="承运人" Binding="{Binding VVSPED}"/>
                        <DataGridTextColumn Header="数量（码）" Binding="{Binding VVTMTR}"/>
                        <DataGridTextColumn Header="重量（KG)" Binding="{Binding VVTKG}"/>
                        <DataGridTextColumn Header="发货日期" Binding="{Binding VVVERSDAT}"/>
                    </DataGrid.Columns>
                </DataGrid  >
            </Grid>
            
      
    </Grid>
</local:DocumentBase>